//
//  Funcs.swift
//  DF_Student
//
//  Created by 刘盖 on 2023/12/13.
//  Copyright © 2023 DFJGED. All rights reserved.
//

import Foundation

public func lg_isStringEmpty(_ str: String?) -> Bool {
    if let strTemp = str {
        if strTemp == "<null>" || strTemp == "(null)" {
            return true
        }
        if strTemp.trimmingCharacters(in: CharacterSet.whitespaces).count == 0 {
            return true
        }
        return false
    }
    return true
}

public func lg_print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
    #if DEBUG
    print(items, separator: separator, terminator: terminator)
    #endif
}


//public func lg_debounce(seconds: TimeInterval, deFunc: (() -> Void)?) -> () -> Void{
//    var shouldPrevent: Bool = false
//    if shouldPrevent {
//        return
//    }
//    shouldPrevent = true
//    DispatchQueue.asyncAfter(T##self: DispatchQueue##DispatchQueue)
//}

//kPreventRepeatClickTime(_seconds_) \
//static BOOL shouldPrevent; \
//if (shouldPrevent) return; \
//shouldPrevent = YES; \
//dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((_seconds_) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
//shouldPrevent = NO; \
//}); \
